﻿@model LocalizationModel

<div class="layui-form" lay-filter="layuiadmin-form-resource" id="layuiadmin-form-resource" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <u-label asp-for="Name" />
        <div class="layui-input-block">
            <u-editor asp-for="Name" />
        </div>
    </div>
    <div class="layui-form-item">
        <u-label asp-for="Value" />
        <div class="layui-input-block">
            <u-editor asp-for="Value" />
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="set_system_submit_btn" id="set_system_submit_btn" value="提交">
    </div>
</div>

<script>
    layui.use(['index', 'form'], function () {
        var $ = layui.$
            , form = layui.form;

        //监听提交
        form.on('submit(set_system_submit_btn)', function (data) {
            var field = data.field; //获取提交的字段
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引

            //提交 Ajax 成功后，关闭当前弹层并重载表格
            $.post('@Url.Action("Add")', field, function(rep) {
                parent.layui.table.reload('LAY-resource-list'); //重载表格
                parent.layer.close(index); //再执行关闭
            });
        });
    })
</script>
